import {Component} from 'react';
import HeadSearch from '../../components/medicalInstrument/search'
import ShowData from '../../components/medicalInstrument'
import axios from 'axios'

class EquipmentAll extends Component {
    constructor(props) {
        super(props);
        this.state = {
            showData:[]
        }
    }

    componentWillMount(){
        axios({
            url:"http://localhost:3000/medicalInstrument",
        }).then(res=>{
            this.setState({
                showData:res.data
            })
        })
    }

    getSearchData(Data){
        this.setState({
            showData:Data
        })
    }
    render() { 
        return ( 
            <div>
                <HeadSearch getSearchData={(Data)=>this.getSearchData(Data)}  />
                <ShowData showData={this.state.showData}/>           
            </div>
        );
    }
}
 
export default EquipmentAll;